package collections.map;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class HashMapTest {
	static Map<String, Integer> map;

	public static void main(String[] args) {
		System.out.println("Try entering something!");
		map = new HashMap<>();
		Scanner scanner = new Scanner(System.in);
		while (add(scanner.nextLine())) ;
		int i = 0;
		while (true) {
			String contest = scanner.nextLine();
			if (contest.isEmpty()) break;
			System.out.println(map.get(contest));
		}

	}

	static boolean add(String content) {
		if (map == null) {
			System.out.println("Map not initiated");
			return false;
		}
		if (content == null || content.isEmpty()) {
			System.out.println(map);
			return false;
		}
		map.put(content, content.length());
		return true;
	}
}
